package jd;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Scanner;

public class JDTest {
    @Test
    public void sj() {
        ApplicationContext context = new ClassPathXmlApplicationContext("lanMoRing.xml");
        Player player = context.getBean("cts", Player.class);


        // 打印初始装备信息
        System.out.println("初始头盔: " + player.getArmet().getName());
        System.out.println("初始铠甲: " + player.getLoricae().getName());
        System.out.println("初始鞋子: " + player.getBoot().getName());
        System.out.println("初始指环: " + player.getRing().getName());
        System.out.println();

        Equip Armet = new Equip("超级无敌头盔", "头盔", 10000000L, 10000000L, 10000000L);
        player.updateEqi(Armet);

        Equip Loricae = new Equip("超级无敌铠甲", "铠甲", 10000000L, 10000000L, 10000000L);
        player.updateEqi(Loricae);

        Equip Boot = new Equip("超级无敌鞋子", "鞋子", 10000000L, 10000000L, 10000000L);
        player.updateEqi(Boot);

        Equip Ring = new Equip("紫色梦幻," + player.getRing().getName(), "指环", 8L, 18L, 8L);
        player.updateEqi(Ring);

        System.out.println();

        // 打印升级后的装备信息及属性
        System.out.println("升级后的头盔: " + player.getArmet().getName() + ", 速度增效: " + player.getArmet().getSpeedPlus() + ", 攻击增效: " + player.getArmet().getAttackPlus() + ", 防御增效: " + player.getArmet().getDefensePlus());
        System.out.println("升级后的铠甲: " + player.getLoricae().getName() + ", 速度增效: " + player.getLoricae().getSpeedPlus() + ", 攻击增效: " + player.getLoricae().getAttackPlus() + ", 防御增效: " + player.getLoricae().getDefensePlus());
        System.out.println("升级后的鞋子: " + player.getBoot().getName() + ", 速度增效: " + player.getBoot().getSpeedPlus() + ", 攻击增效: " + player.getBoot().getAttackPlus() + ", 防御增效: " + player.getBoot().getDefensePlus());
        System.out.println("升级后的指环: " + player.getRing().getName() + ", 速度增效: " + player.getRing().getSpeedPlus() + ", 攻击增效: " + player.getRing().getAttackPlus() + ", 防御增效: " + player.getRing().getDefensePlus());
    }
}
